import Taro, { Component } from '@tarojs/taro'
import { View, Button, Text } from '@tarojs/components'

import './index.scss'

class Square extends Component {
    render() {
        let pieceClass = '';
        if (this.props.value == 'x') {
            pieceClass = 'blackPiece'
        }
        if (this.props.value == 0) {
            pieceClass = 'whitePiece'
        }
        return (
            <div class='square' onClick={() => this.props.onClick()}>
                <div className={pieceClass} ></div>
            </div>
        )
    }
}

export default Square
